package com.celtic.dao.impl;

import java.util.List;

import org.appfuse.dao.hibernate.GenericDaoHibernate;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.celtic.dao.ProjectDao;
import com.celtic.model.Project;

@Repository
public class ProjectDaoHibernate extends GenericDaoHibernate<Project,Long> implements ProjectDao{

	public ProjectDaoHibernate() {
		super(Project.class);
		log.debug("instantiating projectdaOHIBERNATE @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Project> findByProjectName(String name) {
		 log.fatal("Name  from DAO:"+name);
		 return (List<Project>)getSession().createCriteria(Project.class).add(Restrictions.eq("projectNm", name)).list();
	}
	
	
	
	

}
